<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>层叠性和选择器权重计算</title>
    <style>
   ul .gu {color: orange !important; }
   span{color: green;}
   #div p.p span{color: red;}
    </style>
</head>
<body>
    <ul>
        <li style="color: green;"class="gu">js基础</li>
        <li>js函数</li>
        <li>js对象</li>
    </ul>
    <ol>
        <li class="gu">css基础</li>
        <li>css函数</li>
        <li>css对象</li>
    </ol>
    <div id="div">
        <p class="p"><span>就近原则,</span>权值相同</p>
        <p class="p2"><span>权值不同,</span>那个高，就用哪个</p>
    </div>
</body>
</html>